#ifndef _H_TIMER
#define _H_TIMER

#include <time.h>

#define CLOCKS_PER_MS ((clock_t)CLOCKS_PER_SEC/(clock_t)1000)

class timer{

    protected:
        bool running;
        bool ended;

        clock_t startTime;
        clock_t duration;

    public:
        timer();
        ~timer();

        void setDuration(clock_t);
        void start();
        void reset();

        clock_t getDuration();
        clock_t getCurrentTime();
        float getProgress();

        bool isEnded();
        bool isRunning();
};

#endif
